-
Notifications
You must be signed in to change notification settings - Fork 56
Onboards flow-framework plugin to resource-sharing and access control framework #1251
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Onboards flow-framework plugin to resource-sharing and access control framework #1251
Conversation
… framework Signed-off-by: Darshit Chanpura <[email protected]>
|
CI will resolve once: opensearch-project/security#5677 is merged. |
Signed-off-by: Darshit Chanpura <[email protected]>
…e-sharing tests Signed-off-by: Darshit Chanpura <[email protected]>
8f62909 to
6937e06
Compare
Signed-off-by: Darshit Chanpura <[email protected]>
dace39b to
69009e6
Compare
|
CI blocked by #1252 |
Signed-off-by: Darshit Chanpura <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1st iteration
build.gradle
Outdated
| testImplementation("org.junit.jupiter:junit-jupiter:${junitJupiterVersion}") | ||
| testImplementation("com.fasterxml.jackson.datatype:jackson-datatype-jsr310:${versions.jackson_databind}") | ||
|
|
||
| testImplementation 'org.awaitility:awaitility:4.3.0' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Constant for the version
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ack.
| // | Output for ./bin/opensearch-plugin:ERROR: transport error 202: connect failed: Connection refused | ||
| // | ERROR: JDWP Transport dt_socket failed to initialize, TRANSPORT_INIT(510) | ||
| // | JDWP exit error AGENT_ERROR_TRANSPORT_INIT(197): No transports initialized [src/jdk.jdwp.agent/share/native/libjdwp/debugInit.c:700]. | ||
| // So instead, we listen to a debugger by saying server=y and suspend=n |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we remove the comments?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no, let's keep it to understand what these changes mean.
| * @return true if resource-authz should be used, false otherwise | ||
| */ | ||
| public static boolean shouldUseResourceAuthz(String resourceType) { | ||
| var client = ResourceSharingClientAccessor.getInstance().getResourceSharingClient(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we make it explicit
| var client = ResourceSharingClientAccessor.getInstance().getResourceSharingClient(); | |
| ResourceSharingClient client = ResourceSharingClientAccessor.getInstance().getResourceSharingClient(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
compilation may fail if security plugin is absent and by extension SPI is absent as well.
(because of the import statement)
src/main/java/org/opensearch/flowframework/util/ParseUtils.java
Outdated
Show resolved
Hide resolved
src/main/java/org/opensearch/flowframework/transport/PluginClient.java
Outdated
Show resolved
Hide resolved
src/main/java/org/opensearch/flowframework/transport/PluginClient.java
Outdated
Show resolved
Hide resolved
src/main/java/org/opensearch/flowframework/transport/PluginClient.java
Outdated
Show resolved
Hide resolved
| Request request, | ||
| ActionListener<Response> listener | ||
| ) { | ||
| if (subject == null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
subject would be null with the first constructor call, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we don't expect subject to be null, this is added to ensure robustness.
src/main/java/org/opensearch/flowframework/util/ResourceSharingClientAccessor.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Darshit Chanpura <[email protected]>
Signed-off-by: Darshit Chanpura <[email protected]>
Description
Implements resource-access-control for workflow and workflow_state.
Related Issues
Check List
--signoff.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.